package algo3.algocity.vista;

import java.awt.TextField;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.JLabel;

public class CustomKeyListener implements KeyListener {

				JLabel statusLabel;
				TextField textField;
				
				public CustomKeyListener(JLabel lab,TextField textField){
					this.statusLabel = lab;
					this.textField = textField;
				}
		
	   	      public void keyTyped(KeyEvent e) {           
		      }

		      public void keyPressed(KeyEvent e) {
		         if(e.getKeyCode() == KeyEvent.VK_ENTER){
		            
					statusLabel.setText("Entered text: " + textField.getText());
		           
		         }
		      }

		      public void keyReleased(KeyEvent e) {            
		      }    
		   } 
		

